home *** CD-ROM | disk | FTP | other *** search
/ Info-Mac 3 / Info_Mac_1994-01.iso / Development / Source / Morpion 1.0.0 Source / Morpion.p < prev    next >
Text File  |  1993-12-03  |  1KB  |  68 lines

  1. program Morpion;
  2.  
  3.     uses
  4.         MySystemGlobals, MyFMenus, MyOOMainLoop, {}
  5.         MyOOMenus, BaseGlobals, MyAppleEvents, MyDialogs, MyUtils, Game, MySpeak;
  6.  
  7.     procedure HandleMainEvents;
  8.         var
  9.             b: boolean;
  10.             fw: windowPtr;
  11.             er: eventRecord;
  12.     begin
  13.         if SetOOMenuBar then
  14.             DrawMenuBar;
  15.         fw := FrontWindow;
  16.         b := GetWObject(fw).WaitForEvent(er, 10);
  17.         b := GetWObject(fw).HandleEvents(er);
  18.     end;
  19.  
  20.     function DoQuit: OSErr;
  21.     begin
  22.         quitNow := true;
  23.         DoQuit := noErr;
  24.     end;
  25.  
  26.     procedure DoMenuThing;
  27.     begin
  28.     end;
  29.  
  30.     procedure SetMenuThing (themenu, theitem: integer);
  31.     begin
  32.         SetIDItemEnable(themenu, theitem, false);
  33.     end;
  34.  
  35.     var
  36.         oe: OSErr;
  37.         dummy: boolean;
  38.         launched_with_option: boolean;
  39.         mainloop_dobj: DObject;
  40.         er: eventRecord;
  41. begin
  42.     if Get1Resource('BNDL', 128) = nil then begin
  43.         SysBeep(1);
  44.         halt;
  45.     end;
  46.     dummy := GetOSEvent(0, er);
  47.     launched_with_option := BAND(er.modifiers, optionKey) <> 0;
  48.     InitSystemGlobals;
  49.     new(mainloop_dobj);
  50.     InitMainLoop(mainloop_dobj, @DoFMenu);
  51.     InitOOMenus(nil);
  52.     InitSpeak;
  53.     InitGame;
  54. {    SetFBoth('sinf', @DoOpenInfo, @SetOpenInfo);}
  55.     if has_appleevents then
  56.         oe := InitAppleEvents(nil, nil, nil, @DoQuit);
  57.  
  58.     UnloadSeg(@SegmentInit);
  59.     InitCursor;
  60.     while not quitNow do begin
  61.         HandleMainEvents;
  62.     end;
  63.  
  64.     FinishGame;
  65.     FinishSpeak;
  66.     FinishOOmenus;
  67.     FinishMainLoop;
  68. end.